<?php  
   
    function procedure_call($pr)
    {  
        require("./Conn.php");
        $array = Array();
        if (!$conn) 
        { 
            $m = oci_error();
            trigger_error(htmlentities($m['message']), E_USER_ERROR);
        } 
        $curs = oci_new_cursor($conn);
        $stid = oci_parse($conn, "begin ".$pr."(:cursorAux); end;");
        //$stid = oci_parse($conn, "begin PRC001(:cursorAux); end;");
        oci_bind_by_name($stid, ":cursorAux", $curs, -1, OCI_B_CURSOR);
        oci_execute($stid);
        oci_execute($curs);  // Execute the REF CURSOR like a normal statement id 
        while ($row = oci_fetch_array($curs, OCI_ASSOC)) 
        { 
            array_push($array, $row);
        } 
        return $array;
    } 
    
    function procedure_call_2args($pr, $var)
    {  
        require("./Conn.php");
        $array = Array();
        if (!$conn) 
        {
            $m = oci_error();
            trigger_error(htmlentities($m['message']), E_USER_ERROR);
        } 
        $curs = oci_new_cursor($conn);
        $stid = oci_parse($conn, "begin ".$pr."(:cursorAux, ".$var."); end;");
        oci_bind_by_name($stid, ":cursorAux", $curs, -1, OCI_B_CURSOR);
        oci_execute($stid);
        oci_execute($curs);  // Execute the REF CURSOR like a normal statement id 
        $i =0; 
        while ($row = oci_fetch_array($curs, OCI_ASSOC)) 
        {   
            array_push($array, $row);
        } 
        return $array;
    }